// import axios from '@/utils/request'
export default {
  ProfitType: {
    list: {
      disabled_actions: ['delete'],
      list_filter: {
        // 'store.id': () => {
        //   return axios
        //     .get(`/manage/stores`)
        //     .then(res =>
        //       Object.assign({ __label: '门店' },
        //         ...res.data.map(v => { return { [v.id]: v.name } })))
        // }
      },
      list_display: [
        'id',
        'name',
        'type',
        'slug',
        'no',
        'serviceClassName',
        'enabled'
      ]
    },
    form: {
      fields: [
        {
          property: 'store',
          required: false
        },
        'name',
        { property: 'type',
          type: 'select',
          type_options: {
            'allow-create': false,
            options: [
              { value: 'order', label: '订单' },
              { value: 'order-system', label: '系统订单' },
              { value: 'salary', label: '工资' },
              { value: 'salary-system', label: '系统工资' }
            ]
          }
        },
        'slug',
        'no',
        'serviceClassName',
        {
          property: 'relationExpression',
          type: 'code'
        },
        'constant',
        'enabled'
      ]
    }
  }
}

